<template>
  <div class="reportFormPage horizontal-border">
    <div class="report-dom horizontal">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">沥青混合料马歇尔试验检测记录(体积法)2</div>
        <div class="codeText">
          <tr>
            JGLQ10027
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span v-if="isPdf" class="placeholder">{{ form.jilbh }}</span>
          <el-input class="code-input" v-else type="text" v-model="form.jilbh" @focus="handleFocus('jilbh')" />
        </div>
      </div>
      <div class="table-border">
        <!-- .........................1111111111111111111111111111111......................................................... -->
        <table height="150px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="30" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ placeholder: !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>
                <span>；样品数量：</span>
                <span :class="{ placeholder: !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ placeholder: !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ placeholder: !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjsd }}</span
                >%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" style="width: 15%" />℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" style="width: 15%" />%RH
              </td>
            </tr>

            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark" @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView" @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="30" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark" @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="300px" class="middle-table">
          <tbody>
            <tr height="25">
              <td>沥青用量(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.liqyl" @change="countYxhd" @keydown.native="handleKeyDown($event, 0, 0)" :ref="'0_0'" /></td>
              <td colspan="3">击实温度(℃)</td>
              <td colspan="2"><el-input type="text" v-model="form.jiswd" @keydown.native="handleKeyDown($event, 0, 1)" :ref="'0_1'" /></td>
              <td colspan="3">环境温度(℃)</td>
              <td colspan="2"><el-input type="text" v-model="form.huanjwd" @keydown.native="handleKeyDown($event, 0, 2)" :ref="'0_2'" /></td>
              <td colspan="2">试件尺寸(mm)</td>
              <td colspan="2"><el-input type="text" v-model="form.shijcc" @keydown.native="handleKeyDown($event, 0, 3)" :ref="'0_3'" /></td>
            </tr>
            <tr height="25">
              <td>击实次数</td>
              <td colspan="2"><el-input type="text" v-model="form.jiscs" @keydown.native="handleKeyDown($event, 1, 0)" :ref="'1_0'" /></td>
              <td colspan="3">理论最大相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.lilzdxdmd" @keydown.native="handleKeyDown($event, 1, 1)" :ref="'1_1'" /></td>
              <td colspan="3">矿料合成毛体积相对密度γ sb</td>
              <td colspan="2"><el-input type="number" v-model="form.kuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 1, 2)" :ref="'1_2'" /></td>
              <td colspan="2">沥青相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.liqdxdmd" @change="countYxhd" @keydown.native="handleKeyDown($event, 1, 3)" :ref="'1_3'" /></td>
            </tr>
            <tr height="25">
              <td>合成矿料的有效相对密度γ se</td>
              <td colspan="2"><el-input type="number" v-model="form.heckldyxxdmd" @keydown.native="handleKeyDown($event, 2, 0)" :ref="'2_0'" /></td>
              <td colspan="3">矿料合成表现相对密度γ sa</td>
              <td colspan="2"><el-input type="number" v-model="form.kuanglhcbgxdmd" @keydown.native="handleKeyDown($event, 2, 1)" :ref="'2_1'" /></td>
              <td colspan="3">被集料吸收的沥青结合料比例Pba(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.liqjhlbl" @keydown.native="handleKeyDown($event, 2, 2)" :ref="'2_2'" /></td>
              <td colspan="2">有效沥青用量Pbe(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.youxlqyl" @change="countYxhd" @keydown.native="handleKeyDown($event, 2, 3)" :ref="'2_3'" /></td>
            </tr>
            <tr height="25">
              <td width="15%">筛孔尺寸(mm)</td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[0].shaikcc" @keydown.native="handleKeyDown($event, 3, 0)" :ref="'3_0'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[1].shaikcc" @keydown.native="handleKeyDown($event, 3, 1)" :ref="'3_1'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[2].shaikcc" @keydown.native="handleKeyDown($event, 3, 2)" :ref="'3_2'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[3].shaikcc" @keydown.native="handleKeyDown($event, 3, 3)" :ref="'3_3'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[4].shaikcc" @keydown.native="handleKeyDown($event, 3, 4)" :ref="'3_4'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[5].shaikcc" @keydown.native="handleKeyDown($event, 3, 5)" :ref="'3_5'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[6].shaikcc" @keydown.native="handleKeyDown($event, 3, 6)" :ref="'3_6'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[7].shaikcc" @keydown.native="handleKeyDown($event, 3, 7)" :ref="'3_7'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[8].shaikcc" @keydown.native="handleKeyDown($event, 3, 8)" :ref="'3_8'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[9].shaikcc" @keydown.native="handleKeyDown($event, 3, 9)" :ref="'3_9'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[10].shaikcc" @keydown.native="handleKeyDown($event, 3, 10)" :ref="'3_10'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[11].shaikcc" @keydown.native="handleKeyDown($event, 3, 11)" :ref="'3_11'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[12].shaikcc" @keydown.native="handleKeyDown($event, 3, 12)" :ref="'3_12'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[13].shaikcc" @keydown.native="handleKeyDown($event, 3, 13)" :ref="'3_13'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[14].shaikcc" @keydown.native="handleKeyDown($event, 3, 14)" :ref="'3_14'" /></td>
              <td style="width: calc(85% / 16)"><el-input type="number" v-model="form.detailList[15].shaikcc" @keydown.native="handleKeyDown($event, 3, 15)" :ref="'3_15'" /></td>
            </tr>
            <tr height="25">
              <td>表面积系数FAi(m²/kg)</td>
              <td><el-input type="number" v-model="form.detailList[0].biaomjxs" @keydown.native="handleKeyDown($event, 4, 0)" :ref="'4_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].biaomjxs" @keydown.native="handleKeyDown($event, 4, 1)" :ref="'4_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].biaomjxs" @keydown.native="handleKeyDown($event, 4, 2)" :ref="'4_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].biaomjxs" @keydown.native="handleKeyDown($event, 4, 3)" :ref="'4_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].biaomjxs" @keydown.native="handleKeyDown($event, 4, 4)" :ref="'4_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].biaomjxs" @keydown.native="handleKeyDown($event, 4, 5)" :ref="'4_5'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].biaomjxs" @keydown.native="handleKeyDown($event, 4, 6)" :ref="'4_6'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].biaomjxs" @keydown.native="handleKeyDown($event, 4, 7)" :ref="'4_7'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].biaomjxs" @keydown.native="handleKeyDown($event, 4, 8)" :ref="'4_8'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].biaomjxs" @keydown.native="handleKeyDown($event, 4, 9)" :ref="'4_9'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].biaomjxs" @keydown.native="handleKeyDown($event, 4, 10)" :ref="'4_10'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].biaomjxs" @keydown.native="handleKeyDown($event, 4, 11)" :ref="'4_11'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].biaomjxs" @keydown.native="handleKeyDown($event, 4, 12)" :ref="'4_12'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].biaomjxs" @keydown.native="handleKeyDown($event, 4, 13)" :ref="'4_13'" /></td>
              <td><el-input type="number" v-model="form.detailList[14].biaomjxs" @keydown.native="handleKeyDown($event, 4, 14)" :ref="'4_14'" /></td>
              <td><el-input type="number" v-model="form.detailList[15].biaomjxs" @keydown.native="handleKeyDown($event, 4, 15)" :ref="'4_15'" /></td>
            </tr>
            <tr height="25">
              <td>质量通过百分率Pi(%)</td>
              <td><el-input type="number" v-model="form.detailList[0].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 0)" :ref="'5_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 1)" :ref="'5_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 2)" :ref="'5_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 3)" :ref="'5_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 4)" :ref="'5_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 5)" :ref="'5_5'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 6)" :ref="'5_6'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 7)" :ref="'5_7'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 8)" :ref="'5_8'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 9)" :ref="'5_9'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 10)" :ref="'5_10'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 11)" :ref="'5_11'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 12)" :ref="'5_12'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 13)" :ref="'5_13'" /></td>
              <td><el-input type="number" v-model="form.detailList[14].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 14)" :ref="'5_14'" /></td>
              <td><el-input type="number" v-model="form.detailList[15].zhiltgbfl" @keydown.native="handleKeyDown($event, 5, 15)" :ref="'5_15'" /></td>
            </tr>
            <tr height="25">
              <td>集料的比表面积Pi×FAi(m²/kg)</td>
              <td><el-input type="number" v-model="form.detailList[0].jildbbmj" @change="countBmjzh()" @keydown.native="handleKeyDown($event, 6, 0)" :ref="'6_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].jildbbmj" @change="countBmjzh()" @keydown.native="handleKeyDown($event, 6, 1)" :ref="'6_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].jildbbmj" @change="countBmjzh()" @keydown.native="handleKeyDown($event, 6, 2)" :ref="'6_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].jildbbmj" @change="countBmjzh()" @keydown.native="handleKeyDown($event, 6, 3)" :ref="'6_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 4)" :ref="'6_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 5)" :ref="'6_5'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 6)" :ref="'6_6'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 7)" :ref="'6_7'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 8)" :ref="'6_8'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 9)" :ref="'6_9'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 10)" :ref="'6_10'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 11)" :ref="'6_11'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 12)" :ref="'6_12'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 13)" :ref="'6_13'" /></td>
              <td><el-input type="number" v-model="form.detailList[14].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 14)" :ref="'6_14'" /></td>
              <td><el-input type="number" v-model="form.detailList[15].jildbbmj" @change="countBmjzh" @keydown.native="handleKeyDown($event, 6, 15)" :ref="'6_15'" /></td>
            </tr>
            <tr height="25">
              <td>集料的比表面积总和Pi×FAi(m²/kg)</td>
              <td colspan="5"><el-input type="number" v-model="form.jildbbmjzh" disabled /></td>
              <td colspan="6">沥青膜有效厚度DA(μm)</td>
              <td colspan="5"><el-input type="number" v-model="form.liqmyxhd" disabled /></td>
            </tr>
          </tbody>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="60px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block ;margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import { listLqhhlMxetjf2jlbBsInfo, getLqhhlMxetjf2jlbBsInfo, delLqhhlMxetjf2jlbBsInfo, addLqhhlMxetjf2jlbBsInfo, updateLqhhlMxetjf2jlbBsInfo } from "@/api/report_lqhhl/lqhhlMxetjf2jlbBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BaQjDetailView from "@/views/sycs/baQjDetail/BaQjDetailView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";

import decimal from "@/utils/big-decimal";
import { handleFocus, emptyConvert, handleKeyDown } from "@/views/reportForms/utils";
import Bus from "@/utils/bus";
export default {
  name: "lqhhlmxetjf2jlb",
  components: {
    BsInstrumentView,
    BaQjDetailView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      params: {},
      query: {},
      // 表单参数
      form: {
        detailList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
      }
    };
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  created() {
    this.getInfo();
  },
  methods: {
    // 获取详情
    getInfo() {
      getLqhhlMxetjf2jlbBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setLqhhlmxetjfBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },
    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setLqhhlmxetjfBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },

    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },
    submitForm() {
      return this.form;
    },
    // 集料的比表面积总和Pi×FAi(m²/kg)
    countBmjzh() {
      let jildbbmjArr = this.form.detailList.map((v) => {
        if (v.jildbbmj) return Number(v.jildbbmj);
      });
      let allNum = [];
      for (let i = 0; i < this.form.detailList.length; i++) {
        if (jildbbmjArr[i]) {
          allNum.push(jildbbmjArr[i]);
        }
      }
      const sum = allNum.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
      this.form.jildbbmjzh = decimal.round(sum, 2);
      this.countYxhd();
    },
    // 沥青膜有效厚度DA(μm)
    countYxhd() {
      let h = this.form.liqyl; //沥青用量
      let g = this.form.liqdxdmd; //沥青相对密度
      let f = this.form.youxlqyl; //有效沥青用量Pbe
      let A = this.form.jildbbmjzh; //集料的比表面积总和
      if (A && h && g && f) {
        let data = (f / [g * 0.9971 * (1 - h / 100) * A]) * 10;
        this.form.liqmyxhd = decimal.round(data, 2);
        Bus.$emit("setLqhhlMxesyjcbgListTjf", [
          {
            key: 151,
            value: this.form.liqmyxhd
          }
        ]);
      }
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [3, 3, 3, 15, 15, 15, 15];
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    }
  }
};
</script>

<style scoped>
</style>
